package com.org.sort;

import java.util.Collections;
import java.util.List;

@SuppressWarnings("serial")
public abstract class AbConcurrentListSort<T> extends ConcurrentSort<T> {
    protected List<T> list;

    public AbConcurrentListSort(List<T> list) {
        this(list, 0x10);
    }

    public AbConcurrentListSort(List<T> list, int threadloads) {
        this(list, 0, list.size() - 1, threadloads);
    }

    protected AbConcurrentListSort(List<T> list, int start, int end, int threadloads) {
        this.list = list;
        this.began = start;
        this.end = end;
        this.threadloads = threadloads;
    }

    @Override
    protected void swap(int posOne, int posTwo) {
        if (posOne != posTwo) {
            Collections.swap(list, posOne, posTwo);
        }
    }

    @Override
    protected T getValueIndex(int index) {
        return list.get(index);
    }

}
